#include<bits/stdc++.h>
using namespace std;
int n,a[100001],b[100001],c[100001],s=0;
void d(int b[],int c[]){
	for(int i=2;i<=b[0];i++){
		if(b[i]>=b[i-1]){
			s+=b[i-1];
		}
		else if(b[i-1]>b[i]){
			s+=b[i];
			c[++c[0]]=b[i-1]-b[i];
		}
	}
	if(b[b[0]]>b[b[0]-1])c[++c[0]]=b[b[0]]-b[b[0]-1];
	if(c[0]<=1){
		return;
	}
	b[0]=0;
	d(c,b);
}
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	b[++b[0]]++;
	for(int i=2;i<=n;i++){
		if(a[i]==a[i-1]){
			b[b[0]]++;
		}else{
			b[++b[0]]++;
		}
	}
	d(b,c);
	cout<<n-s;
	return 0;
}
